#ifndef SOCKET_UTILS_H
#define SOCKET_UTILS_H

#include <sys/socket.h>
#include <errno.h>
#include <netinet/in.h>

#define INVALID_SOCKET -1
#define SOCKET_ERROR -1

typedef int SOCKET;
typedef struct sockaddr_in SOCKADDR_IN;
typedef struct sockaddr SOCKADDR;
typedef struct in_addr IN_ADDR;

int init_connection(int port, int maxClients);
void remove_client(SOCKET *clients, int to_remove, int *actual);
void write_client(SOCKET sock, const char *buffer);
int read_client(SOCKET sock, char *buffer, int tailleBuffer);
void end_connection(int sock);

#endif
